package com.jk.service;

import com.jk.dao.CreditDao;
import com.jk.dao.LenderDao;
import com.jk.dao.RecordDao;
import com.jk.entity.CreditEntity;
import com.jk.entity.IntegrationEntity;
import com.jk.entity.LenderEntity;
import com.jk.entity.RecordEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 位佳生
 * @title: LenderService
 * @projectName springboot_financial
 * @description: TODO
 * @date 2022/11/816:25
 */
@Service
public class LenderService {
    @Autowired
    private LenderDao lenderDao;
    @Autowired
    private CreditDao creditDao;
    @Autowired
    private RecordDao recordDao;

    public IntegrationEntity getInter(Integer propertyId) {
        LenderEntity lenderEntity = lenderDao.selectById(propertyId);
        CreditEntity creditEntity = creditDao.selectById(lenderEntity.getLender_credit());
        RecordEntity recordEntity = recordDao.selectById(lenderEntity.getRecord_id());
        IntegrationEntity integrationEntity = new IntegrationEntity();
        integrationEntity.setLenderEntity(lenderEntity);
        integrationEntity.setRecordEntity(recordEntity);
        integrationEntity.setCreditEntity(creditEntity);
        return integrationEntity;
    }
}
